package part13_访问者模式_歌手打分;

import java.util.LinkedList;
import java.util.List;

/**
 * @ClassName: ObjectStructure
 * @Author: AllenSun
 * @Date: 2020/3/5 23:06
 */
public class ObjectStructure {
    //维护了一个集合
    private List<Person> persons=new LinkedList<Person>();

    //增加到List
    public void attach(Person p){
        persons.add(p);
    }
    //删除出List
    public void detach(Person p){
        persons.remove(p);
    }

    //显示测评的情况
    public void deisplay(Action action){
        for (Person person : persons) {
            person.accept(action);
        }
    }

}
